<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>设置背景图</title>
    <style>
        div{
            width: 161px;
            height: 156px;
            background-image: url("test.png");
            background-repeat:no-repeat;
            margin: 0 auto;
            border: solid 1px red;
            /*background-position: 10px 20px;*/
            background-size:50px 50px;
        }
    </style>
</head>
<body>
<div></div>
<img src="test.png" alt="找不到该图片">
</body>
</html>